<?php
	include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/database/core/DatabaseColumn.php';
	include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/database/core/IIgnorableColumn.php';
	include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/database/core/IDatabaseRecord.php';
	
	class Transient extends DatabaseColumn implements IIgnorableColumn
	{
		public function __construct(IDatabaseRecord &$object)
		{
			$this->model = $object;
		}
		
		public function __get($property)
		{
			$method = $this->column;
			if($this->model){
				return $this->model->$method();
			}
		}

		public function __set($property, $value)
		{
			if($this->model)
			{
				$method = 'set'.strtoupper($this->column[0]).substr($this->column, 1);
			
				if(method_exists($this->model, $method)){
					$this->model->$method($value);
				}
			}
		}
	}
?>
